package top.tsyz.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "UserAddress 实体类")
public class UserAddress {

    @ApiModelProperty(value = "地址ID")
    private Long id;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "收货人姓名")
    @NotBlank(message = "收货人姓名不能为空")
    @Size(max = 50, message = "收货人姓名长度不能超过50个字符")
    private String name;

    @ApiModelProperty(value = "联系电话")
    @NotBlank(message = "联系电话不能为空")
    @Size(max = 20, message = "联系电话长度不能超过20个字符")
    private String phone;

    @ApiModelProperty(value = "省份")
    @NotBlank(message = "省份不能为空")
    @Size(max = 50, message = "省份长度不能超过50个字符")
    private String province;

    @ApiModelProperty(value = "城市")
    @NotBlank(message = "城市不能为空")
    @Size(max = 50, message = "城市长度不能超过50个字符")
    private String city;

    @ApiModelProperty(value = "区/县")
    @NotBlank(message = "区/县不能为空")
    @Size(max = 100, message = "区/县长度不能超过100个字符")
    private String district;

    @ApiModelProperty(value = "详细地址")
    @NotBlank(message = "详细地址不能为空")
    @Size(max = 255, message = "详细地址长度不能超过255个字符")
    private String address;

    @ApiModelProperty(value = "是否默认地址 0-否 1-是")
    private Boolean isDefault;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "创建人")
    @Size(max = 50, message = "创建人长度不能超过50个字符")
    private String createUser;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "更新人")
    @Size(max = 50, message = "更新人长度不能超过50个字符")
    private String updateUser;

    @ApiModelProperty(value = "逻辑删除 0-未删除 1-已删除")
    private Boolean isDeleted;

}
